{include file='_header'}
<title>商品详情</title>
<link rel="stylesheet" href="/public/static/plugin/groups/css/style.css?v=2018531" />
<link href="/public/static/plugin/auction/css/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
	.creditshop-detail-page .fui-navbar .abtn{height:2.6rem;width:40%;font-size:12px;-webkit-border-radius: 0;border-radius: 0;padding:0.5rem 0 0 0;display: block;float:left;
		line-height: 0.8rem;}
	.creditshop-detail-page .fui-navbar .homeabtn{height:2.6rem;width:20%;font-size:12px;-webkit-border-radius: 0;border-radius: 0;margin:0;padding:0;display: block;float:left;background: #fff;
		color:#666;border:none;line-height: 2.6rem;}
	.homeabtn .icon{font-size:1rem;}
	.text-danger span{color:#ef4f4f;font-size:1rem;}
	.lynn_goods_head_title i{
		font-style: normal;
		font-size: 0.55rem;
		color: #999;
		text-align: right;
		margin-left: 0.5rem;
	}
</style>
<script  language='javascript'>
    function getHeight (obj){
        var w = obj.width;
        var h = obj.height;
        console.error('h:'+ h +'     w:'+w)
        var height = ((750*h) / w) / 40 + 'rem';
        $('.fui-swipe').css('height', height );
        $('.fui-swipe .fui-swipe-wrapper .fui-swipe-item img').css('height', height);
    }
</script>
<div class='fui-page creditshop-detail-page'>
	<a href="{:url('order')}" class="iconfont icon lynn_back_icon back">&#xe755;</a>
	<div class='fui-content'>
		{if !is_mobile()}<div class="pcshop-index">{/if}
		<div class="fui-swipe" data-speed="5000" data-gap="5" style="height: 0;">
			<div class="fui-swipe-wrapper">
				{foreach name="goods['thumb_url']" key='index' item='thumb'}
				<div class="fui-swipe-item">
					{if $index == "0" }
					<img src="{:tomedia($thumb)}" onload="getHeight(this)" alt="{$goods['title']}" onerror="this.src='/public/static/images/nopic100.jpg'">
					{else}
					<img src="{:tomedia($thumb)}" alt="{$goods['title']}" onerror="this.src='/public/static/images/nopic100.jpg'">
					{/if}
				</div>
				{/foreach}
			</div>
			<div class="fui-swipe-page">
				{foreach name="goods['thumb_url']" item='thumb'}
				<div class="fui-swipe-bullet"></div>
				{/foreach}
			</div>
		</div>
		<div class="lynn_goods_head">
			<h2 class="lynn_goods_head_title" style="font-size: 0.7rem;">{$goods['title']}<br> <i>{$goods['description']}</i></h2>
			<div class="price">
				<strong>起拍价 ¥ {$goods['shprice']}</strong> 保证金¥ {$goods['bond']}&nbsp;&nbsp;&nbsp;&nbsp;加价幅度¥ {$goods['addprice']}
			</div>
			<p class="total">{if $goods['pos']==0 && time() >$goods['endtime']}已流拍{else}当前价：￥{$goods['stprice']}{/if}</p>
	        <div class="join_num">
				<div  class="bar">
					<div  style="width:{$goods['bili']}%;"  class="bar_in"></div>
				</div>
		        <span  class="att_num" id="LeftTime"></span>
		        <span  class="remain_num">出价次数：<span  class="fc">{$goods['pos']}</span>次</span> 
		    </div>
		</div>

		<div class="lynn_goods_invitation">
			<div class="invitation-title">拍卖玩法</div>
			<div class="fui-cell-group" style="margin-top: 0">
				<a href="{:url('mobile/auction/rules')}" class="fui-cell" style="text-decoration:none;padding: 0.4rem 0.6rem 0.45rem 0;">
					<div class="fui-cell-info" style="color: #999;font-size: 0.65rem;">缴纳保证金，参与竞拍。价高者得</div>
					<div class="fui-cell-remark"></div>
				</a>
			</div>
		</div>
		{if count($list) > 0}
		<section  class="white_box">
		    <div  class="record_list" id="gift">
		      <h3>最近参与记录</h3>
		      <span  class="ico_clock"></span>
		    <div  class="date"><span  class="dot"></span></div>
		      <ul>
		        {foreach name='list' key='gid' item='lists'}
		        <li>
		        	<span  class="dot"><i></i></span>
		          	<p><span  class="fc"><a  style="color:#ee433e;"  href="">{$lists['nickname']}</a></span> 出价<span  class="fc">{$lists['price']}元</span></p>
		          	<span  class="time">{:date('Y-m-d H:i:s',$lists['createtime'])}</span> 
		        </li>
		        {/foreach} 
		      </ul>
		    </div>
		</section>
		{/if}
		<div class="lynn_goods_content">
			<div class="lynn_goods_content_title"><span>图文详情</span></div>
			<div class="lynn_goods_content_info content-images" id="content">
				{if $auctionset['description']}
				{:htmlspecialchars_decode($auctionset['auction_description'])}
				{else}
				{:htmlspecialchars_decode($goods['content'])}
				{/if}
			</div>
		</div>
		<div style="height:2.5rem;"></div>
		{if !is_mobile()}</div>{/if}
	</div>
	<div class="fui-navbar bordert" style="z-index:100;padding:0;display: flex;-webkit-flex: 1">
		<a class="homeabtn btn btn-warning {if empty($goods['stock'])}disabled{/if} external" style="padding-top: 0.3rem" href="{:url('mobile/auction/index')}">
			<p class="icon icon-home1" style="line-height: 1rem"></p>
			<p style="line-height: 1rem">拍卖首页</p>
		</a>
		{if $goods['single']}
		<a class="lynn_goods_btn lynn_btn_waring btn-single" href="javascript:void(0);">
			<p>{if $goods['single']}¥ <strong>{$goods['singleprice']}</strong>{else}<br />{/if}</p> 一口价
		</a>
		{/if}

		{if !empty($bondorder)}
		<a class="lynn_goods_btn lynn_btn_danger" data-nocache="true" href="{:url('mobile/auction/bidconfirm',array('id'=>$goods['id']))}">
			{if $goods['status'] == 1}
			<p style="margin-top: 10px"><strong>我要出价</strong></p>
			{/if}
		</a>
		{else}
		<a class="lynn_goods_btn lynn_btn_danger" data-nocache="true" href="{:url('mobile/auction/bondpay',array('id'=>$goods['id']))}">
			{if $goods['status'] == 1}
			<p style="margin-top: 10px"><strong>交保证金</strong></p>
			{/if}
		</a>
		{/if}
	</div>
	<div class='layer'style="display: none" ></div>
	<!--多规格弹窗  -->
	<div class='fui-modal goods-picker in goodslist' style="display: none">
		<div class='option-picker'>
			<div class='option-picker-inner'>
				<div class='fui-list'>
					<div class='fui-list-media'>
						<image class='thumb' src={$goods['thumb']}></image>
					</div>
					<div class='fui-list-inner'>
						<div class='subtitle'>{$goods['title']}</div>
						<div class='price'>{$goods['auctionprice']}</div>
						<div class='option_id'style="display: none" ></div>
					</div>
				</div>
				<div class='option-picker-options'>
					<div class='option-picker-cell option spec'>
					</div>
				</div>
			</div>
			<div class='sure'><div class='btn btn-danger block'>确定</div></div>
		</div>
		<div class='icon icon-guanbi1' style='color:#fff;text-align:center;font-size:1.25rem;margin-top:0.75rem;' bindtap='emptyActive'> </div>
	</div>
</div>
<script language='javascript'>
    function FreshTime()
	{
	    var str ='{:date('Y-m-d H:i:s',$goods['starttime'])}';
	    str = str.replace(/-/g,"/");
	    var starttime= new Date(str);//开始时间
	    var strr ='{:date('Y-m-d H:i:s',$goods['endtime'])}';
	    strr = strr.replace(/-/g,"/");
	    var endtime=new Date(strr);//结束时间
	    var nowtime = new Date();//当前时间
	    if (nowtime > starttime) {
	        var lefttime=parseInt((endtime.getTime()-nowtime.getTime())/1000); 
	        d=parseInt(lefttime/3600/24);
	        h=parseInt((lefttime/3600)%24);
	        m=parseInt((lefttime/60)%60);
	        s=parseInt(lefttime%60);
	       
	        document.getElementById("LeftTime").innerHTML="时间剩余："+d+"天"+h+"时"+m+"分"+s+"秒";
	        if(lefttime<=0){
	        document.getElementById("LeftTime").innerHTML="拍卖已结束";
	        clearInterval(sh);
	        }
	    }else{
	        document.getElementById("LeftTime").innerHTML="拍卖未开始";
	        clearInterval(sh);
	    }
	}
	FreshTime()
	var sh;
	sh=setInterval(FreshTime,1000);
</script>
{include file='_footer'}